<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    {$LOAD_STYLE.top|raw}
</head>
	<body class="pear-container">
		<div class="layui-card">
			<div class="layui-card-body">
				<form class="layui-form layui-form-pane" action="">
					<div class="layui-form-item">
                           
               <div class="layui-form-item layui-inline">
                   <label class="layui-form-label">供应商名称</label>
                   <div class="layui-input-inline">
                       <input type="text" name="sup_name" placeholder="" class="layui-input">
                   </div>
               </div>
                <div class="layui-form-item layui-inline">
                       <button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="query">
                           <i class="layui-icon layui-icon-search"></i>
                           查询
                       </button>
                       <button type="reset" class="pear-btn pear-btn-md">
                           <i class="layui-icon layui-icon-refresh"></i>
                           重置
                       </button>
                       </div>
                    </div>
				</form>
			</div>
		</div>
		<div class="layui-card">
			<div class="layui-card-body">
				<table id="dataTable" lay-filter="dataTable"></table>
			</div>
		</div>

		<script type="text/html" id="toolbar">
			<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
		        <i class="layui-icon layui-icon-add-1"></i>
		        新增
			</button>
			<button class="pear-btn pear-btn-danger pear-btn-md" lay-event="batchRemove">
		        <i class="layui-icon layui-icon-delete"></i>
		        删除
		    </button>
            <!-- <button class="pear-btn pear-btn-md" lay-event="recycle">
		        <i class="layui-icon layui-icon-delete"></i>
		        回收站
		    </button> -->
		</script>

        
               <script type="text/html" id="status">
                   <input type="checkbox" name="status" value="{{d.id}}" lay-skin="switch" lay-text="启用|禁用" lay-filter="status" {{# if(d.status==1){ }} checked {{# } }}>
               </script>

        <script type="text/html" id="cut_payment">
        <div>
        	{{# if(d.cut_payment==1){ }}
        	<span class="layui-tag pear-btn-green">现结</span>
        	{{# }else if(d.cut_payment==2){ }}
        	<span class="layui-tag pear-btn-red">欠款</span>
        	{{# } }}
        </div>
        </script>
        
        <script type="text/html" id="bulk">
        <div>
        	{{# if(d.bulk==0){ }}
        	不能
        	{{# }else if(d.bulk==1){ }}
        	<span class="layui-tag pear-btn-green">可以</span>
        	{{# } }}
        </div>
        </script>
        
        <script type="text/html" id="bulk_payment">
        <div>
        	{{# if(d.bulk_payment==1){ }}
        	<span class="layui-tag pear-btn-green">现结</span>
        	{{# }else if(d.bulk_payment==2){ }}
        	<span class="layui-tag pear-btn-red">欠款</span>
        	{{# } }}
        </div>
        </script>
        
        
		<script type="text/html" id="options">
			<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i class="layui-icon layui-icon-edit"></i></button>
		    <button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i class="layui-icon layui-icon-delete"></i></button>
		</script>
        <script>
        layui.use(['jquery','common','mycomm','table'], function() {
            let $ = layui.jquery;
			let common = layui.common;
			let mycomm = layui.mycomm;
			let table = layui.table;
            let MODULE_PATH = "{$MODULE_PATH}";
            
            
            let cols = [
                [{
                        type: 'checkbox'
                    },{
                       field: "id",
                       title: "供应商ID",
                       unresize: "true",
                       align: "center"
                   }, {
                       field: "sup_name",
                       title: "供应商名称",
                       unresize: "true",
                       align: "center"
                   }, {
                       field: "exp_method",
                       title: "提货方式",
                       unresize: "true",
                       align: "center"
                   }, {
                       field: "cut_payment",
                       title: "版布结算",
                       unresize: "true",
                       align: "center",
                       templet:"#cut_payment",
                   }, {
                       field: "bulk_payment",
                       title: "大货结算",
                       unresize: "true",
                       align: "center",
                       templet:"#bulk_payment",
                   }, {
                       field: "exp_name",
                       title: "发货物流",
                       unresize: "true",
                       align: "center",
                    }, {
                        field: "bulk",
                        title: "散剪公斤",
                        unresize: "true",
                        align: "center",
                        templet:"#bulk",
                    }, {
                        field: "bulk_price",
                        title: "散剪加价",
                        unresize: "true",
                        align: "center",
                    }, {
                        field: "weixin",
                        title: "微信",
                        unresize: "true",
                        align: "center",
                    }, {
                        field: "phone",
                        title: "联系电话",
                        unresize: "true",
                        align: "center",
                    }, {
                        field: "address",
                        title: "联系地址",
                        unresize: "true",
                        align: "center"
                   }, {
                       field: "remark",
                       title: "备注",
                       unresize: "true",
                       align: "center"
                   }, {
                       field: "status",
                       title: "状态",
                       unresize: "true",
                       align: "center",
                       templet:"#status"
                   }, {
                        title: '操作',
                        toolbar: '#options',
                        unresize: true,
                        align: 'center',
                        width:180,
                    }
                ]
            ]
			
			mycomm.tableInit('{$controller_title}',MODULE_PATH,cols);

        })
    </script>
	{$LOAD_STYLE.bottom|raw}
	</body>
</html>
